home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2005 December / DPPCPRO1205.ISO / Essentials / Programming / Basic4GL / Setup Basic4GL v2.3.1.exe / $INSTDIR / Programs / nehe3.gb < prev    next >
Encoding:
Text File  |  2005-07-29  |  1.0 KB  |  21 lines

  1.     glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT)    ' Clear The Screen And The Depth Buffer
  2.     glLoadIdentity()                            ' Reset The View
  3.     glTranslatef(-1.5,0.0,-6.0)                    ' Move Left 1.5 Units And Into The Screen 6.0
  4.     glBegin(GL_TRIANGLES)                            ' Drawing Using Triangles
  5.         glColor3f(1.0,0.0,0.0)                    ' Set The Color To Red
  6.         glVertex3f( 0.0, 1.0, 0.0)                    ' Top
  7.         glColor3f(0.0,1.0,0.0)                    ' Set The Color To Green
  8.         glVertex3f(-1.0,-1.0, 0.0)                    ' Bottom Left
  9.         glColor3f(0.0,0.0,1.0)                    ' Set The Color To Blue
  10.         glVertex3f( 1.0,-1.0, 0.0)                    ' Bottom Right
  11.     glEnd()                                    ' Finished Drawing The Triangle
  12.     glTranslatef(3.0,0.0,0.0)                        ' Move Right 3 Units
  13.     glColor3f(0.5,0.5,1.0)                        ' Set The Color To Blue One Time Only
  14.     glBegin(GL_QUADS)                            ' Draw A Quad
  15.         glVertex3f(-1.0, 1.0, 0.0)                    ' Top Left
  16.         glVertex3f( 1.0, 1.0, 0.0)                    ' Top Right
  17.         glVertex3f( 1.0,-1.0, 0.0)                    ' Bottom Right
  18.         glVertex3f(-1.0,-1.0, 0.0)                    ' Bottom Left
  19.     glEnd()                                    ' Done Drawing The Quad
  20.     SwapBuffers ()
  21.